{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 第二次课作业"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（1）创建一个1到10的数组，然后逆序输出。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（2）创建一个长度为20的全1数组，然后变成一个4×5的二维矩阵并转置。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（3）创建一个3x3x3的随机数组。\n",
    "(提示: np.random.random)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（4）从1到10中随机选取10个数，构成一个长度为10的数组，并将其排序。获取其最大值最小值，求和，求方差。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（5）从1到10中随机选取10个数，构成一个长度为10的数组，选出其中的奇数。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（6）生成0到100，差为5的一个等差数列，然后将数据类型转化为整数。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（7）从1到10中随机选取10个数，大于3和小于8的取负数。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（8）在数组[1, 2, 3, 4, 5]中相邻两个数字中间插入1个0。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（9）新建一个5乘5的随机二位数组，交换其中两行？比如交换第一二行。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（10）把一个10\\*2的随机生成的笛卡尔坐标转换成极坐标。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（11）创建一个长度为10并且除了第五个值为1其余的值为2的向量。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（12）创建一个长度为10的随机向量，并求其累计和。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（13）将数组中的所有奇数替换成-1。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（14）构造两个4乘3的二维数组，按照3种方法进行连接？"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（15）获取数组 a 和 b 中的共同项（索引位置相同，值也相同）。\n",
    "a = np.array([1,2,3,2,3,4,3,4,5,6])，b = np.array([7,2,10,2,7,4,9,4,9,8])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "（16）从数组 a 中提取 5 和 10 之间的所有项。a=np.array([7,2,10,2,7,4,9,4,9,8])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
